package com.link2room.rodimus.feign.jetfire;

import com.link2room.common.dto.result.base.BaseResultDto;
import com.link2room.jetfire.dto.param.base.ReservationParamDto;
import com.link2room.jetfire.dto.param.inside.ReservationPayInsideParamDto;
import com.link2room.jetfire.dto.result.base.ReservationBaseDto;
import com.link2room.jetfire.dto.result.base.ReservationDto;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * Created by sss on 2016/11/17.
 */
@FeignClient("${spring.gateway.name}/${feign.jetfire}")
public interface ReservationsFeignService {
    /**
     * 下单
     * @param reservationParamDto
     * @throws Exception
     */
    @RequestMapping(method = RequestMethod.POST, value = "/in/Reservations",consumes = MediaType.APPLICATION_JSON_VALUE)
    BaseResultDto<ReservationBaseDto> createReservation(@RequestBody ReservationParamDto reservationParamDto)throws Exception;
    /**
     * 取消订单
     * @param paramMap
     * @throws Exception
     */
    @RequestMapping(method = RequestMethod.DELETE, value = "/in/Reservations",consumes = MediaType.APPLICATION_JSON_VALUE)
    BaseResultDto cancelReservation(@RequestParam Map<String, Object> paramMap)throws Exception;
    /**
     * 查询订单
     * @param paramMap
     * @throws Exception
     */
    @RequestMapping(method = RequestMethod.GET, value = "/in/Reservations/Reservation",consumes = MediaType.APPLICATION_JSON_VALUE)
    BaseResultDto<ReservationDto> getReservation(@RequestParam Map<String, Object> paramMap)throws Exception;
    /**
     * 支付入账
     * 
     * @param reservationPayInsideParamDto
     * @throws Exception
     */
    @RequestMapping(method = RequestMethod.POST, value = "/in/Reservations/Payments",consumes = MediaType.APPLICATION_JSON_VALUE)
    BaseResultDto payment(@RequestBody ReservationPayInsideParamDto reservationPayInsideParamDto)throws Exception;

}
